﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web;
using MvcEngine.Core.Website;
using MvcEngine.Core;
using MvcEngine.Core.Extensions;
using MvcEngine.Mvc.Extensions;
using MvcEngine.Core.Account;
using MvcEngine.Core.Localization;
using MvcEngine.Mvc.Models;

namespace MvcEngine.Mvc.ModelBinders
{
    public class ForgotPasswordModelBinder : ModelBinderBase
    {
        public override object Bind(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            HttpRequestBase request = controllerContext.HttpContext.Request;
            ForgotPasswordViewModel model = new ForgotPasswordViewModel();
            model.Email = request.Form.Get("Email");

            Validate(model, controllerContext);
            return model;
        }
    }
}
